SlkStore.GetStore Method

Returns the SlkStore object associated the SharePoint SPSite that a given SharePoint SPWeb belongs to. If no such object exists (i.e. if SharePoint Learning Kit was not yet configured for the specified SPSite in SharePoint Central Administration), an exception is thrown.

Parent Type: SlkStore

Namespace: Microsoft.SharePointLearningKit

Assembly: Microsoft.SharePointLearningKit.dll

Syntax
C#

public static SlkStore GetStore (
SPWeb spWeb

)

Parameters

spWeb

The SharePoint SPWeb from which to retrieve the current user's identity and the identity of the SPSite of the SLK store to open.

Exceptions
Exception type Condition
SafeToDisplayException

An error occurred that can be displayed to a browser user. Possible cause: spWeb isn't configured for use with SharePoint Learning Kit.

UserNotFoundException

The current user is not signed into SharePoint.

Remarks

If there is an active HttpContext (i.e. if the caller is executing from within the context of ASP.NET web page code), the retrieved SlkStore is cached for a period of time specified by HttpContextCacheTime: that many seconds after being loaded, the next time GetStore is called the SlkSPSiteMapping information is reloaded from the SharePoint configuration database, and the SlkSettings information is reloaded from the SharePoint Learning Kit database.

If there is no active HttpContext, no caching is performed.